#version 300 es
uniform mat4 uMVPMatrix;
uniform mat4 uMMatrix;
uniform vec3 uCamera;
in vec3 aPosition;
in vec3 aNormal;

out vec3 vEye ;
out vec3 vNormal  ;


void main() {
   gl_Position = uMVPMatrix * vec4(aPosition,1);

  vec3 normalTarget=aPosition+aNormal;
  vec3 newNormal=(uMMatrix*vec4(normalTarget,1)).xyz-(uMMatrix*vec4(aPosition,1)).xyz;
  vNormal=normalize(newNormal);
  vEye =- normalize(uCamera-(uMMatrix*vec4(aPosition,1)).xyz);


  //vTextureCoord=reflect(eye,newNormal);
  //vTextureCoord=refract(-eye,newNormal , 0.94);
}
